package Exercise;

public class RegexExe1 {
    public static void main(String[] args) {
        //验证电话号码
        //第一位只能是1 第二位3-9 其余随意

        System.out.println("13732271915".matches("1[3-9]\\d{9}"));

        //验证座机电话号码
        String tru="0\\d{2,3}-?[1-9]\\d{4,9}";
        System.out.println("0717-24242".matches("0[0-9][0-9-]{3}[0-9]{3,}"));
        System.out.println("0717-24242".matches(tru));


        //验证邮箱
        String tru1="\\w+@[\\w&&[^_]]{2,6}(\\.[a-zA-z]{2,3}){1,2}";
        System.out.println("3396881897@qq.com".matches(tru1));

        String tru2="(([^<>()[\\]\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))";


    }
}
